package cn.wubo.vrr.help.controller;

import cn.wubo.vrr.help.entity.EhrPerson;
import cn.wubo.vrr.help.service.EhrPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/ehrperson")
public class EhrPersonController {

    @Autowired
    EhrPersonService ehrPersonService;

    @RequestMapping(value = "/save")
    @ResponseBody
    public EhrPerson save(@RequestParam(value = "oprid", required = true) String oprid,
                          @RequestParam(value = "pwd", required = true) String pwd,
                          @RequestParam(value = "username", required = true) String username) {
        EhrPerson p = new EhrPerson();
        p.setOprid(oprid);
        p.setPwd(pwd);
        p.setUsername(username);
        return ehrPersonService.save(p);
    }
}
